<!-- addEditItem.html 2017-09-01 14:55:21-->
<div class="ibox">
	<div class="ibox-title">
		<h5>项编辑</h5>
		<div class="pull-right">
			#if(treeItem.id) <a href="javascript:" style="font-size:12px;color:#666" onclick="add(#(treeItem.id))">新增子项</a>  
			<a href="javascript:" style="font-size:12px;color:#666" onclick="add(#(treeItem.parent_id))">新增同级项</a>  #end
   		<a href="javascript:" style="font-size:12px;color:#666" onclick="closeEdit()">关闭</a>
    </div>
	</div>
	<div class="ibox-content">
		<form id="form" class="form-horizontal required-validate" method="post" action="saveItem" novalidate="novalidate" onsubmit="return validateCallback(this,thisAjaxDone)">
			<input type="hidden" name="treeItem.id" value="#(treeItem.id)"/>
			<input type="hidden" name="treeItem.parent_id" value="#(treeItem.parent_id)"/>
			<input type="hidden" name="treeItem.info_id" value="#(treeItem.info_id)"/>
			<div class="form-group">
		   	<label class="col-xs-2 control-label">上级项：</label>
		     <div class="col-xs-9" style="line-height: 35px">
		     #if(parentItem)#(parentItem.name)#else无#end
		     </div>
		  </div>
			<div class="form-group">
				<label class="col-xs-2 control-label">名称：</label>
				<div class="col-xs-9">
					<input type="text" class="form-control required" name="treeItem.name" value="#(treeItem.name)"/>
				</div>
			</div>			
			<div class="form-group">
				<label class="col-xs-2 control-label">图片：</label>
				<div class="col-xs-9">
    			<div class="input-group">
    				<input type="text" class="form-control " name="treeItem.image" id="treeItem_image" value="#(treeItem.image)"/>
   					<span class="input-group-btn">
   						<button class="btn btn-primary" type="button" onclick="layer.open({content:'#(res_path)#(PRE_PATH)/common/files/upload?directory=common&input=treeItem_image',area: ['600px', '200px'],type: 2,title: '上传文件'})">上传</button>
   					</span>
   				</div>
				</div>
			</div>		
			<div class="form-group">
				<label class="col-xs-2 control-label">链接：</label>
				<div class="col-xs-9">
					<input type="text" class="form-control " name="treeItem.url" value="#(treeItem.url)"/>
				</div>
			</div>			
			<div class="form-group">
				<label class="col-xs-2 control-label">图标：</label>
				<div class="col-xs-4">
					<input type="text" class="form-control " name="treeItem.icon" value="#(treeItem.icon)"/>
				</div>
				<label class="col-xs-2 control-label">排序：</label>
				<div class="col-xs-4">
		<input type="text" class="form-control digits required" name="treeItem.sort" value="#(treeItem.sort??"100")"/>
				</div>
			</div>			
			<div class="form-group">
				<label class="col-xs-2 control-label">状态：</label>
				<div class="col-xs-9">
		#for(item:data("ENABLE_FLAG"))
		<label style="font-weight:normal;line-height: 37px;margin-bottom: 0px;padding-right: 5px"><input class="required" type="radio" name="treeItem.enable_flag" #if(treeItem.enable_flag)#if(treeItem.enable_flag==item.key)checked="checked"#end#elseif(item.key=="T")checked="checked"#end value="#(item.key)"/> #(item.value.name) </label>
		#end
				</div>
			</div>		  
			<div class="form-group">
		   	<div class="col-xs-9 col-xs-offset-2">
		     	<button type="submit" class="btn btn-primary">保存</button>
		     	#if(treeItem.id)
		     		  <a class="btn btn-danger" href="deleteItem?id=#(treeItem.id)&info_id=#(treeItem.info_id)" target="ajaxTodo" title="确定删除吗？" callback="deleteAjaxTodo">删除</a>
		     	#end
		    </div>
		  </div>
		</form>
 	</div>
</div>